package com.finer.controller;

import com.finer.entity.ResponseMessage;
import com.finer.entity.document.FinerCustomer;
import com.finer.remote.document.FinerCustomerRemote;
import com.finer.service.FinerCustomerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 客户表(FinerCustomer)表控制层
 *
 * @author makejava
 * @since 2024-10-21 10:20:37
 */
@RestController
@CrossOrigin
@RequestMapping("finerCustomer")
public class FinerCustomerController  {
    /**
     * 服务对象
     */
    @Resource
    private FinerCustomerService finerCustomerService;

    private Logger logger = LoggerFactory.getLogger(FinerCustomerController.class);

    @RequestMapping("getCustomerList")
    public ResponseMessage getCustomerList(@RequestBody Map map){
        logger.info("consumer FinerCustomerController getCustomerList  start....map:"+map);
        ResponseMessage responseMessage = finerCustomerService.getCustomerList(map);
        return responseMessage;
    }

    @RequestMapping("delCus")
    public ResponseMessage delCus(@RequestBody Map map){
        logger.info("consumer FinerCustomerController delCus  start....map:"+map);
        ResponseMessage responseMessage = finerCustomerService.delCus(map);
        return responseMessage;
    }

    @RequestMapping("addCus")
    public ResponseMessage addCus(@RequestBody Map map){
        logger.info("consumer FinerCustomerController addCus  start....map:"+map);
        ResponseMessage responseMessage = finerCustomerService.addCus(map);
        return responseMessage;
    }

    @RequestMapping("updCus")
    public ResponseMessage updCus(@RequestBody Map map){
        logger.info("consumer FinerCustomerController updCus  start....map:"+map);
        ResponseMessage responseMessage = finerCustomerService.updCus(map);
        return responseMessage;
    }

    @RequestMapping("getCusById")
    public ResponseMessage getCusById(@RequestBody Map map){
        logger.info("consumer FinerCustomerController getCusById  start....map:"+map);
        ResponseMessage responseMessage = finerCustomerService.getCusById(map);
        return responseMessage;
    }
}

